#!/bin/bash

#
# Convert an image cropping it to a square
#
# ----------
# -- Args --
# ----------

convert - -background white -flatten \
          -colorspace Gray -negate -edge 1 -negate -normalize \
          -threshold 50% -despeckle \
          -blur 0x.5 -contrast-stretch 0x50% \
          "${1:-png}":-
